package states.gameplay;

public class GameUtils {
	public static Position getGridPositionFromCoords(int mouseX, int mouseY, int mouseyDisplacement, int cell_size){
		Position result = null;
		
		mouseY -= mouseyDisplacement;
		
		int x = mouseX / cell_size;
		int y = mouseY / cell_size;
		
		if( x >= 0 && x < ShaporGrid.GRID_WIDTH && y >= 0 && y < ShaporGrid.GRID_HEIGHT){
			result = new Position(x, y);
		}
				
		return result;
	}
}
